package com.koron.device.bean;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;
import java.util.Objects;

/**
 * @ClassName EquipmentLocationBean
 * @description
 * @Author 朱超
 * @Date 2021/7/22
 */

@Data
public class EquipmentLocation {

    @ApiModelProperty(value = "id")
    private String id;

    @ApiModelProperty(value = "地理位置系统编码")
    private String code;

    @ApiModelProperty(value = "位置名称")
    private String name;

    @ApiModelProperty(value = "位置名称")
    private String namePy;

    @ApiModelProperty(value = "父级编码id")
    private String parentId;

    @javax.persistence.Transient
    @ApiModelProperty(value = "父级编码")
    private String parentCode;

    @ApiModelProperty(value = "父级名称")
    private String parentName;

    @ApiModelProperty(value = "关联组织id")
    private String orgId;

    @ApiModelProperty(value = "关联组织名称")
    private String orgName;

    @ApiModelProperty(value = "层级")
    private Integer level;

    @ApiModelProperty(value = "层级编码")
    private Integer levelCode;

    @ApiModelProperty(value = "层级路径")
    private String levelPath;

    @ApiModelProperty("全路径编码")
    private String fullPathCode;

    @ApiModelProperty("全级路径名称")
    private String fullPathName;

    @ApiModelProperty(value = "排序")
    private Integer sort;

    @ApiModelProperty(value = "删除标志")
    private Integer deleteFlag;

    @ApiModelProperty(value = "状态")
    private String status;

    @ApiModelProperty("录入时的坐标")
    private String enterLatLon;

    @ApiModelProperty("录入时的坐标类型")
    private String csysType;

    @ApiModelProperty(value = "经纬度")
    private String latlon;

    @ApiModelProperty(value = "有效范围")
    private Integer range;

    @ApiModelProperty(value = "备注")
    private String desc;

    @ApiModelProperty(value = "创建人ID", hidden = true)
    private String createUserId;

    @ApiModelProperty(value = "创建人姓名", hidden = true)
    private String createUserName;

    @ApiModelProperty(value = "创建时间", hidden = true)
    private Date createTime;

    @ApiModelProperty(value = "修改人ID", hidden = true)
    private String updateUserId;

    @ApiModelProperty(value = "修改人姓名", hidden = true)
    private String updateUserName;

    @ApiModelProperty(value = "最后修改时间", hidden = true)
    private Date updateTime;

    @ApiModelProperty(value = "高度")
    private String height;

    // 业务字段
    @javax.persistence.Transient
    @ApiModelProperty(value = "子节点")
    private List<EquipmentLocation> children;

    @javax.persistence.Transient
    @ApiModelProperty(value = "关联设备")
    private List<Equipment> equipmentList;

    @javax.persistence.Transient
    @ApiModelProperty(value = "父级层级")
    private Integer parentLevel;

    @ApiModelProperty("数据来源")
    private String dataSources;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        EquipmentLocation that = (EquipmentLocation) o;
        return id.equals(that.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
